home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Loadstar 36
/
036.d81
/
flags in the win
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2022-08-26
|
3KB
|
122 lines
0 rem flags quiz
10 ifx=0thenx=1:load"hi-res text.o",8,1
20 ifx=1thenx=2:load"unpacker",8,1
30 ifx=2thenx=3:load"flags.lnk",8,1
35 poke56,63:clr
40 :
50 nq=17:dim a$(nq),sn(nq)
55 te=50759:xp=2:yp=18
60 forx=1tonq:reada$(x):sn(x)=x:next
62 data iowa,new mexico,maryland,alaska,rhode island,texas,alabama
64 data north carolina,south carolina,wyoming,oregon,nevada,colorado
66 data district of columbia,california,indiana,massachusetts
70 :
75 gosub 1000:sys51459
77 :
80 c=0:w=0:forx=1tonq:a=int(rnd(1)*nq)+1:b=int(rnd(1)*nq)+1
82 t$=a$(a):a$(a)=a$(b):a$(b)=t$
83 t=sn(a):sn(a)=sn(b):sn(b)=t
84 nextx
90 :
100 forx=1tonq
110 gosub 1000 : rem blank screen
120 gosub 2000 : rem plot shp#sn(x)
130 gosub 3000 : rem ask question
132 fl=0
140 gosub 4000 : rem get/check answer
150 iffl=1thengosub5000:goto110: rem quit?
160 next x
170 goto 6000 : rem evaluation
180 :
1000 rem plot blank
1010 gosub 10000: rem set stuff
1020 poke255,0:sys51462:ag=3.3
1030 return
1040 :
2000 rem plot shp#x
2010 gosub 10000: rem set stuff
2020 poke255,sn(x):poke253,10:poke254,2:sys51462:ag=3.3
2030 return
2040 :
3000 rem ask question
3010 syste,"this is the flag of which state?",xp*8,yp*8
3020 syste,"press [f1] to exit",xp*8,(yp+1)*8
3030 return
3040 :
4000 rem get/check answer
4010 gosub 11000 : rem hi-res input
4011 fora=3to5:syste," ",xp*8,(yp+a)*8
4012 next
4015 iffl=1then4100
4020 if in$<>a$(x) then 4050
4030 syste," correct! ",xp*8,(yp+3)*8:c=c+1:goto4100
4050 syste,"incorrect! the correct state is: ",xp*8,(yp+3)*8:w=w+1
4051 mm=20-len(a$(x))/2-4
4052 syste,a$(x),(xp+mm)*8,(yp+4)*8:poke198,.
4053 rem syste,"the correct state is: "+a$(x),(xp+mm)*8,(yp+4)*8:poke198,.
4100 syste,"press any key to continue...",(xp+3)*8,(yp+5)*8
4105 geta$:ifa$=""then4105
4110 return
5000 rem quit?
5010 gosub 1000
5020 syste,"are you sure you want to quit [y/n]",xp*8,yp*8
5030 poke198,0:wait198,1:geta$
5040 ifa$<>"y"anda$<>"n"anda$<>"[217]"anda$<>"[206]"then5030
5050 ifa$="y"ora$="[217]"then 60000
5060 return
5070 :
6000 rem evaluation
6010 gosub 1000
6020 s$="out of"+str$(nq)+" asked, you got"+str$(c)+" correct."
6022 syste,s$,xp*8,(yp-9)*8
6030 pc=int((c/nq)*100)
6040 s$="this averages out to"+str$(pc)+"% correct."
6042 syste,s$,xp*8,(yp-8)*8
6050 ifpc>=90 thens$="this is an excellent score.":goto6100
6060 ifpc>=80 thens$="this is an above average score.":goto6100
6070 ifpc>=70 thens$="this is an average score.":goto6100
6080 ifpc>=60 thens$="this is a below average score.":goto6100
6090 s$="this is a very poor score."
6100 syste,s$,xp*8,(yp-7)*8
6105 syste,"press any key",(xp+10)*8,yp*8
6107 poke198,0:wait198,1:poke198,0
6110 :
7000 rem play again
7010 gosub 1000
7020 syste,"press [return] to return to loadstar",xp*8,(yp-5)*8
7022 syste,"any other key to play again",(xp+5)*8,(yp-4)*8
7030 poke198,0:wait198,1:getag$
7040 ifag$=chr$(13)then60000
7045 goto80
7050 :
10000 rem set stuff
10010 poke249,224:poke250,204
10020 poke251,0:poke252,64
10030 poke253,0:poke254,0
10040 return
10050 :
11000 rem hi-res input
11010 a$=""
11020 xi=2:yi=23
11030 getk$:ifk$<>""then11070
11040 ifcr$="["thencr$="]":goto11060
11050 cr$="["
11060 sys50759,cr$,xi*8,yi*8:goto11030
11070 ifk$=chr$(13)then11150
11072 ifk$="[133]"thenfl=1:goto11150
11080 ifk$<>"[157]"andk$<>chr$(20)then11100
11090 ifxi>2thenxi=xi-1:sys50759," ",xi*8,yi*8:a$=left$(a$,len(a$)-1):goto11030
11100 ifk$>="[193]"andk$<="[218]"thenk$=chr$(asc(k$)-128)
11105 if(k$>"z"ork$<"a")andk$<>" "andk$<>"."then11030
11110 ifxi=38then11030
11120 sys50759,k$,xi*8,yi*8:xi=xi+1
11130 a$=a$+k$
11140 goto11030
11150 in$=a$:return
60000 rem quit
60010 sys51459:print"[147]"
60020 open15,8,15,"r0:hello connect=hello connect":input#15,er:close15
60030 ifer<>63thenpoke56,160:clr:end
60040 poke56,160:clr:load"hello connect",8
60050 end